<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()
            + "://" + request.getServerName()
            + ":" + request.getServerPort()
            + path + "/";
%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="<%=basePath%>css/pintuer.css">
    <link rel="stylesheet" href="<%=basePath%>css/admin.css">
    <script src="<%=basePath%>js/jquery.js"></script>
    <script src="<%=basePath%>js/pintuer.js"></script>
</head>
<body>
<form method="post" action="">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder">帖子管理</strong></div>
        <table class="table table-hover text-center">
            <tr style="font-family: 'Adobe 仿宋 Std R';font-size: 16px">
                <th width="11.1%">帖子编号</th>
                <th width="11.1%">发贴人</th>
                <th width="11.1%">帖子类型</th>
                <th width="11.1%">帖子标题</th>
                <th width="11.1%">发帖时间</th>
                <th width="7%">浏览量</th>
                <th width="7%">点赞量</th>
                <th width="7%">评论量</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${listTiezi}" var="tiezi">
                <tr>
                    <td>${tiezi.fphoneAddress}</td>
                    <td>${tiezi.userEntity.loginId}</td>
                    <td>${tiezi.type}</td>
                    <td>${tiezi.fname}</td>
                    <td>${tiezi.fphotoName}</td>
                    <td>${tiezi.more2}</td>
                    <td>${tiezi.fdianzan}</td>
                    <td>${tiezi.fnumber}</td>
                    <td>
                        <div class="button-group">
                            <a class="button border-main" href="<%=basePath%>TestSX/findTieziAction?tieziid=${tiezi.id}"><span
                                    class="icon-edit"></span> 查看</a>
                            <a class="button border-red" href="javascript:void(0)" onclick="del('${tiezi.id}')"><span
                                    class="icon-trash-o"></span> 删除</a>
                        </div>
                    </td>
                </tr>
            </c:forEach>
        </table>
    </div>
</form>
<script type="text/javascript">

    function del(id) {
        if (confirm("您确定要删除吗?")) {
            window.location.href = "/TestSX/deleteTieziAction?tieziid=" + id;
        }
    }

    $("#checkall").click(function () {
        $("input[name='id[]']").each(function () {
            if (this.checked) {
                this.checked = false;
            }
            else {
                this.checked = true;
            }
        });
    })

    function DelSelect() {
        var Checkbox = false;
        $("input[name='id[]']").each(function () {
            if (this.checked == true) {
                Checkbox = true;
            }
        });
        if (Checkbox) {
            var t = confirm("您确认要删除选中的内容吗？");
            if (t == false) return false;
        }
        else {
            alert("请选择您要删除的内容!");
            return false;
        }
    }

</script>
</body>
</html>